<?php
/* @var $this StkBannerController */
/* @var $model StkBanner */
/* @var $form CActiveForm */
?>
<script type="text/JavaScript">
	//$('body').css('background', '#fff');
</script>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'stk-banner-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
        'htmlOptions' => array('enctype' => 'multipart/form-data'),
        'enableClientValidation'=>true,
        'clientOptions'=>array(
            'validateOnSubmit'=>true,
        )
)); ?>

	<p class="note">Los campos marcados <span class="required">*</span> son requeridos.</p>

	<?php echo $form->errorSummary($model); ?>
	<table>
		<tr>
			<td WIDTH="50%" >
				<div class="row">
					<?php 
						if($model->Nombre=="")
						{
						  echo $form->textField($model,'Nombre',array('size'=>60,'maxlength'=>200, 'class'=>'formulary_contact',  'value'=>'Nombre Banner','onblur'=>"if (this.value=='') this.value = 'Nombre Banner'", 'onfocus'=>"if (this.value=='Nombre Banner') this.value = ''",)); 
					      echo $form->error($model,'Nombre');
						}
						else
						{
						  echo $form->textField($model,'Nombre',array('size'=>60,'maxlength'=>200, 'class'=>'formulary_contact')); 
					      echo $form->error($model,'Nombre');
						}
					?>
				</div>

				<div class="row">
					<?php echo "Recomendacion: Tamaño Ideal para Imagen de Banner 220px x 158px";?>
					<?php echo $form->labelEx($model,'Url'); ?>
					<?php echo $form->FileField($model,'Url'); ?>
					<?php echo $form->error($model,'Url'); ?>
				</div>
				 <?php if($model->isNewRecord!='1'){ ?>
					<div class="row">
						 <?php echo CHtml::image(Yii::app()->request->baseUrl.'/images/banner/'.$model->Url,"Url",array("width"=>300)); ?>  
					   
					</div>
					<?php } ?>

				<div class="row">
					<?php 
						if($model->Orden=="")
						{
							echo $form->textField($model,'Orden',array('size'=>60, 'class'=>'formulary_contact',  'value'=>'Orden','onblur'=>"if (this.value=='') this.value = 'Orden'", 'onfocus'=>"if (this.value=='Orden') this.value = ''",));
							echo $form->error($model,'Orden');
						}
						if($model->Orden!="")
						{
							echo $form->textField($model,'Orden',array('size'=>60, 'class'=>'formulary_contact'));
							echo $form->error($model,'Orden');
						}
					?>
				</div>

				

					<div class="row">
					<?php $user=STKUsuario::model()->find('LOWER(NombreUsuario)=?',array( Yii::app()->user->name)); ?>
					<!--<?php echo $form->labelEx($model,'Usuario_Id'); ?>-->
					<!--<?php echo $form->textField($model,'Usuario_Id',array('readonly'=>"readonly", 'value'=>$user->id)); ?>-->
					<!--<?php echo $form->textField($model,'Usuario_Id'); ?>-->
					<?php echo $form->hiddenField($model,'Usuario_Id',array('type'=>"hidden",'readonly'=>"readonly", 'value'=>$user->id)); ?>
					<?php echo $form->error($model,'Usuario_Id'); ?>
				</div>

				<div class="row buttons">
					<?php echo CHtml::submitButton($model->isNewRecord ? 'Crear' : 'Guardar', array('class'=>'comment')); ?>
				</div>
			</td>
			<td width="50%" >
				<div style="position:relative; margin-top:-100px; color: #FFF;">
					<p><strong><?php echo $data; ?></strong><p>
				</div>
			</td>
		</tr>
	</table>

<?php $this->endWidget(); ?>

</div><!-- form -->